<script setup>
import { getStatusBarHeight, getTitleBarHeight, getNavBarHeight, getLeftIconLeft } from "@/utils/system.js"

defineProps({
	title:{
		type: String,
		default: '壁纸'
	}
})
</script>

<template>
	<view class="custom-navbar">
		<view class="navbar">
			<view class="statusBar" :style="{ height: getStatusBarHeight() + 'px' }"></view>
			<view class="titleBar" :style="{ height: getTitleBarHeight() + 'px', marginLeft: getLeftIconLeft() + 'px', marginBottom: '3px' }">
				<view class="title">{{ title }}</view>
				<!-- <navigator url="/pages/search/search" class="search">
					 <uni-icons class="icon" type="search" color="#888" size="18"></uni-icons>
					 <text class="text">搜索</text>
				</navigator> -->
			</view>
		</view>
		
		<view class="fill" :style="{height:getNavBarHeight() + 3 + 'px'}"></view>
	</view>
</template>

<style scoped lang="scss">
.custom-navbar {
	.navbar {
		position: fixed;
		top:0;
		left:0;
		width: 100%;
		z-index: 10;
		background:
			linear-gradient(to bottom, transparent, #fff 800px),
			radial-gradient(90% 400rpx at left top, #95E0DC, transparent),
			radial-gradient(60% 400rpx at right top, #D3CBFC, #fff);
		
		.titleBar{
			display: flex;	
			align-items: center;
			padding:0 30rpx;
				
			.title{
				font-size: 22px;
				font-weight: 700;
			}
			
			.search{
				width: 220rpx;
				height: 50rpx;
				border-radius: 60rpx;
				background: rgba(255,255,255,0.4);
				border:1px solid #fff;
				margin-left:30rpx;
				color:#999;
				font-size: 28rpx;
				display: flex;
				align-items: center;
				
				.icon{
					margin-left:5rpx;
				}
				
				.text{
					padding-left:10rpx;
				}
			}
		}
	}
}
</style>
